<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>VueInstance</title>
</head>

<body>
    <!-- Vue实例响应式例子 -->
    <div id="app-1">
        <p>{{ foo }}</p>
        <button v-on:click="foo = 'baz'">Change it</button>
    </div>
</body>

<script src="../vue.js"></script>

<script>
    // Vue实例响应式例子
    var obj = {
        foo: 'bar'
    };
    Object.freeze(obj);//将会锁定obj对象,这样子的话就不能在修改相对应的vue对象
    var app1 = new Vue({
        el: '#app-1',
        data: obj //此时绑定app.foo和data.foo,两个任意改变都会影响到彼此
    });
</script>

</html>